/*
 * keyboard.h
 *
 *  Created on: 2021年3月12日
 *      Author: root
 */

#ifndef __MYOS__DRIVERS__KEYBOARD_H_
#define __MYOS__DRIVERS__KEYBOARD_H_

#include <common/types.h>
#include <hardwarecommunication/interrupts.h>
#include <hardwarecommunication/port.h>
#include <drivers/driver.h>

namespace myos{
	namespace drivers{

		class KeyboardEventHandle{
		public:
			KeyboardEventHandle();
			~KeyboardEventHandle();

			virtual void OnKeyDown(char );
			virtual void OnKeyUP(char );
		};

		class KeyboardDrive:public myos::hardwarecommunication::InterruptHandler,public Driver{

			myos::hardwarecommunication::Port8Bit dataport;			//数据窗口
			myos::hardwarecommunication::Port8Bit commandport; 		//命令窗口

			KeyboardEventHandle* handler;

		public:
			KeyboardDrive(myos::hardwarecommunication::InterruptManager* manager, KeyboardEventHandle* handler );
			~KeyboardDrive();
			virtual myos::common::uint32_t HandleInterrupt(myos::common::uint32_t esp);
			virtual void Activate();
		};

	}
}

#endif /* __MYOS__DRIVERS__KEYBOARD_H_ */
